<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>将 8-bit 字符串转换成 quoted-printable 字符串</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.quoted-printable-decode.html">« quoted_printable_decode</a></li>
      <li style="float: right;"><a href="function.quotemeta.html">quotemeta »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.strings.html">字符串 函数</a></li>
    <li>将 8-bit 字符串转换成 quoted-printable 字符串</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.quoted-printable-encode" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">quoted_printable_encode</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">quoted_printable_encode</span> &mdash; <span class="dc-title">将 8-bit 字符串转换成 quoted-printable 字符串</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.quoted-printable-encode-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>quoted_printable_encode</strong></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$string</code></span>): <span class="type">string</span></div>

  <p class="para rdfs-comment">
   返回 quoted-printable 格式的字符，该格式由 <a href="http://www.faqs.org/rfcs/rfc2045" class="link external">&raquo;&nbsp;RFC2045</a> 6.7.章节里制定。
  </p>
  <p class="para">
   该函数与 <span class="function"><a href="function.imap-8bit.html" class="function">imap_8bit()</a></span> 函数十分相似，不同的是该函数不需要 IMAP 模块就能运行。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.quoted-printable-encode-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">string</code></dt>

     <dd>

      <p class="para">
       输入的字符串。
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.quoted-printable-encode-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   返回编码之后的字符串。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.quoted-printable-encode-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-4802">
    <p><strong>示例 #1 <span class="function"><strong>quoted_printable_encode()</strong></span> 示例</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$encoded&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">quoted_printable_encode</span><span style="color: #007700">(</span><span style="color: #DD0000">'Möchten&nbsp;Sie&nbsp;ein&nbsp;paar&nbsp;Äpfel?'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$encoded</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">quoted_printable_decode</span><span style="color: #007700">(</span><span style="color: #0000BB">$encoded</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
string(37) &quot;M=C3=B6chten Sie ein paar =C3=84pfel?&quot;
string(29) &quot;Möchten Sie ein paar Äpfel?&quot;
</pre></div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.quoted-printable-encode-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.quoted-printable-decode.html" class="function" rel="rdfs-seeAlso">quoted_printable_decode()</a> - 将 quoted-printable 字符串转换为 8-bit 字符串</span></li>
    <li class="member"><span class="function"><a href="function.iconv-mime-encode.html" class="function" rel="rdfs-seeAlso">iconv_mime_encode()</a> - Composes a MIME header field</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>